package com.netinfo.feignconsumer.controller;

import com.netinfo.feignconsumer.service.FeignConsumerService;
import com.netinfo.serviceapi.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignConsumerController {

    @Autowired
    private FeignConsumerService feignConsumerService;

    @RequestMapping("request")
    public String feignConsumer(){
        feignConsumerService.request();
        return "feignConsumer--请求完成";
    }

    @RequestMapping("/requestUser")
    public User feignConsumerByUser(User user){
        feignConsumerService.hello2();
        return feignConsumerService.printUser(user);
    }
}
